package com.feng.newconfig.demos.nacosdiscoveryconsumer;

import io.github.resilience4j.ratelimiter.RateLimiter;
import io.github.resilience4j.ratelimiter.RateLimiterRegistry;
import io.vavr.collection.Seq;
import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.web.bind.annotation.RequestMapping;
import org.springframework.web.bind.annotation.RestController;

/**
 * @author yinglong.zhang
 * @description
 * @date 2024-1-9 15:41
 */
@RequestMapping("/resilience")
@RestController
public class ConfigController {

    @Autowired
    private RateLimiterRegistry rateLimiterRegistry;

    @RequestMapping("config")
    public Seq<RateLimiter> test(){
        return rateLimiterRegistry.getAllRateLimiters();
    }

}
